package com.fivium.bpd.editor;

import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

import com.fivium.bpd.component.QueryDefinition;
import com.fivium.bpd.editor.renderer.QueryCellRenderer;
import javax.swing.JTextField;
import javax.swing.JLabel;

public class DelegationListPanel extends JPanel
{
  private JTextField textNewDelegationName;
  /**
   * Create the panel.
   */
  public DelegationListPanel()
  {
    setLayout(new BorderLayout(0, 0));
    
    JList list = new JList();
    list.setCellRenderer(new QueryCellRenderer());
    
    JScrollPane scrollPane = new JScrollPane(list);
    add(scrollPane, BorderLayout.CENTER);  
    
    JPanel panel = new JPanel();
    add(panel, BorderLayout.SOUTH);
    panel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
    
    JLabel lblNewLabel = new JLabel("Delegation:");
    panel.add(lblNewLabel);
    
    textNewDelegationName = new JTextField();
    panel.add(textNewDelegationName);
    textNewDelegationName.setColumns(10);
    
    JButton addButton = new JButton("Add Delegation");
    panel.add(addButton);
  }

}
